﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
namespace Things.Web.CropsProductProgressInfo
{
    public partial class Show : Page
    {
        public string strid = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    strid = Request.Params["id"];
                    Guid CropsProductProgressInfoID = new Guid(strid);
                    ShowInfo(CropsProductProgressInfoID);
                }
            }
        }

        private void ShowInfo(Guid CropsProductProgressInfoID)
        {
            Things.BLL.CropsProductProgressInfo bll = new Things.BLL.CropsProductProgressInfo();
            Things.Model.CropsProductProgressInfo model = bll.GetModel(CropsProductProgressInfoID);
            this.lblCropsProductProgressInfoID.Text = model.CropsProductProgressInfoID.ToString();
            this.lblCropsID.Text = model.ProductID.ToString();
            this.lblProductProgressID.Text = model.ProductProgressID.ToString();

            Things.BLL.CropsProductProgress cppBLL = new BLL.CropsProductProgress();
            Things.Model.CropsProductProgress cpp = cppBLL.GetModel(model.ProductProgressID);
            this.lblCropProductProgress.Text = cpp != null ? cpp.ProductProgressName : string.Empty;

            Session[Things.Common.ConstantString.Images] = model.Image;
            this.Image1.ImageUrl = "../DisplayImage.aspx";

            this.lblPhotoDatetime.Text = model.PhotoDatetime.Value.ToString("yyyy-MM-dd");
            this.lblCreateDatetime.Text = model.CreateDatetime.Value.ToString("yyyy-MM-dd");
            this.lblComments.Text = model.Comments;

        }


    }
}
